{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": "array([[[  0,   0,   0],\n        [  0,   0,   0],\n        [  0,   0,   0],\n        ...,\n        [  0,   0,   0],\n        [  0,   0,   0],\n        [  0,   0,   0]],\n\n       [[  1,   1,   1],\n        [  1,   1,   1],\n        [  1,   1,   1],\n        ...,\n        [  1,   1,   1],\n        [  1,   1,   1],\n        [  1,   1,   1]],\n\n       [[  2,   2,   2],\n        [  2,   2,   2],\n        [  2,   2,   2],\n        ...,\n        [  2,   2,   2],\n        [  2,   2,   2],\n        [  2,   2,   2]],\n\n       ...,\n\n       [[253, 253, 253],\n        [253, 253, 253],\n        [253, 253, 253],\n        ...,\n        [253, 253, 253],\n        [253, 253, 253],\n        [253, 253, 253]],\n\n       [[254, 254, 254],\n        [254, 254, 254],\n        [254, 254, 254],\n        ...,\n        [254, 254, 254],\n        [254, 254, 254],\n        [254, 254, 254]],\n\n       [[255, 255, 255],\n        [255, 255, 255],\n        [255, 255, 255],\n        ...,\n        [255, 255, 255],\n        [255, 255, 255],\n        [255, 255, 255]]], dtype=uint8)"
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import  cv2\n",
    "import numpy as np\n",
    "\n",
    "img_width=int(input(\"set width\"))\n",
    "arr=np.arange(0,256).reshape(256,1)\n",
    "arr_1=np.ones((1,3*img_width),dtype=int)\n",
    "arr=np.dot(arr,arr_1)\n",
    "arr=arr.reshape(256,img_width,3)\n",
    "arr=arr.astype(\"uint8\")\n",
    "arr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "outputs": [],
   "source": [
    "cv2.imshow(\"img\",arr)\n",
    "cv2.waitKey(0)\n",
    "cv2.destroyAllWindows()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "outputs": [],
   "source": [
    "d1=[]\n",
    "d2=[]\n",
    "for i in range(0,256):\n",
    "    d2=[]\n",
    "    for j in range(0,10):\n",
    "        d2.append(i)\n",
    "        d2.append(i)\n",
    "        d2.append(i)\n",
    "    d1.append(d2)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(256, 30)\n"
     ]
    },
    {
     "data": {
      "text/plain": "array([[[  0,   0,   0],\n        [  0,   0,   0],\n        [  0,   0,   0],\n        ...,\n        [  0,   0,   0],\n        [  0,   0,   0],\n        [  0,   0,   0]],\n\n       [[  1,   1,   1],\n        [  1,   1,   1],\n        [  1,   1,   1],\n        ...,\n        [  1,   1,   1],\n        [  1,   1,   1],\n        [  1,   1,   1]],\n\n       [[  2,   2,   2],\n        [  2,   2,   2],\n        [  2,   2,   2],\n        ...,\n        [  2,   2,   2],\n        [  2,   2,   2],\n        [  2,   2,   2]],\n\n       ...,\n\n       [[253, 253, 253],\n        [253, 253, 253],\n        [253, 253, 253],\n        ...,\n        [253, 253, 253],\n        [253, 253, 253],\n        [253, 253, 253]],\n\n       [[254, 254, 254],\n        [254, 254, 254],\n        [254, 254, 254],\n        ...,\n        [254, 254, 254],\n        [254, 254, 254],\n        [254, 254, 254]],\n\n       [[255, 255, 255],\n        [255, 255, 255],\n        [255, 255, 255],\n        ...,\n        [255, 255, 255],\n        [255, 255, 255],\n        [255, 255, 255]]], dtype=uint8)"
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d1=np.array(d1)\n",
    "\n",
    "print(d1.shape)\n",
    "d1=d1.reshape(256,10,3)\n",
    "d1.astype(\"uint8\")"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "outputs": [],
   "source": [
    "cv2.imshow(\"img\",d1)\n",
    "cv2.waitKey(10000)\n",
    "cv2.destroyAllWindows()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}